#include <SFML/Graphics.hpp>
#include "Utils.hpp"
#include "Game.hpp"

int main()
{
	sf::RenderWindow window(sf::VideoMode(800,600,32), "Battle tank", sf::Style::Close);
	Logger::instance();
	Game game(window);
	game.load();
	game.setTasks(ALL_TASKS);
	while(window.IsOpened())
	{

		sf::Event event;
		while(window.GetEvent(event))
		{	
			if(event.Type == sf::Event::Closed)
				window.Close();
			if(event.Type == sf::Event::KeyPressed && event.Key.Code == sf::Key::Escape)
				window.Close();
		}	
		GlobalClock::instance().update(window.GetFrameTime());
		window.Clear(sf::Color::Black);
		game.update();
		window.Display();
	}	

	return EXIT_SUCCESS;
}
